import {ElMessage} from "element-plus";

export const callbackData = (result) => {
    if (result.code === 1)
        return result.data;

    ElMessage.error(result.msg);
    throw new Error(result.msg);
}

export const callbackCode = (result) => {
    if (result.code === 1)
        return true;

    ElMessage.error(result.msg);
    throw new Error(result.msg);
}


